<!-- 请实现，鼠标点击页面中的任意标签，alert该标签的名称。（注意兼容性） -->

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        div
    </div>
    <span>
        span
    </span>
    <script>
        document.onclick = function (event) {
            event = event || window.event;
            console.log(event)
            // srcElement兼容IE浏览器里
            let target = event['target'] || event['srcElement'];

            alert(target.tagName.toLowerCase())
        }
    </script>
</body>

</html>